
#ifndef KBE_NETWORKTCPPACKET_SENDER_H
#define KBE_NETWORKTCPPACKET_SENDER_H

// #include "common/common.h"
// #include "common/timer.h"
#include "objectpool.h"
/*#include "helper/debug_helper.h"*/
/*#include "network/common.h"*/
#include "interfaces.h"
#include "tcp_packet.h"
#include "packet_sender.h"


class EndPoint;
class Channel;
class Address;
class NetworkInterface;
/*class EventDispatcher;*/

class TCPPacketSender : public PacketSender
{
public:
	typedef KBEShared_ptr< SmartPoolObject< TCPPacketSender > > SmartPoolObjectPtr;
	static SmartPoolObjectPtr createSmartPoolObj();
	static ObjectPool<TCPPacketSender>& ObjPool();
	static void destroyObjPool();
	
	TCPPacketSender():PacketSender(){}
	TCPPacketSender(EndPoint & endpoint, NetworkInterface & networkInterface);
	~TCPPacketSender();

	virtual void onGetError(Channel* pChannel);
	virtual bool processSend(Channel* pChannel);

protected:
	virtual Reason processFilterPacket(Channel* pChannel, Packet * pPacket);
};


#ifdef CODE_INLINE
#include "tcp_packet_sender.inl"
#endif
#endif // KBE_NETWORKTCPPACKET_SENDER_H
